home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
wdj0797.zip
/
TUFFS.ZIP
/
EXCEPT1.CPP
next >
Wrap
C/C++ Source or Header
|
1997-04-24
|
464b
|
21 lines
#include <iostream.h>
#include <stdexcep.h>
#include <cstring.h>
void badFunction(){
throw xmsg("badFunction exception");
}
int main(){
try {
cout << "Calling badFunction()" << endl;
badFunction();
cout << "badFunction() completed without exception" << endl;
} catch (xmsg &x) {
cerr << "Exception caught '" << x.why() << "'" << endl;
} catch (...) {
cerr << "Unknown exception caught" << endl;
}
return 0;
}